﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Themes/Main.master" AutoEventWireup="true" CodeBehind="FunctionList.aspx.cs" Inherits="TrainingsApp.IPADApp.Permission.FunctionList" %>
<%@ Register assembly="TrainingsApp.Controls" namespace="TrainingsApp.Controls.GridViewExt" tagprefix="GridViewExt" %>
<%@ Register assembly="TrainingsApp.Controls" namespace="TrainingsApp.Controls.TextControlExt" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Scripts/Dialog.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        function edit(id) {
            return openChildDialog('功能修改', 'FunctionEdit.aspx?ActionCode=<%=ClientConstSet.Update %>&BizCode=' + id, 650, 300);
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:ScriptManager ID="scriptmanager1" runat="server">
    </asp:ScriptManager>
    <table width="100%" cellpadding="0" cellspacing="1" class="tablist2">
        <tr>
            <td class="td1">
                功能名称
            </td>
            <td class="td2">
                <cc1:TextControlExt ID="Name" runat="server"></cc1:TextControlExt>
            </td>
        </tr>
        <tr>
            <td colspan="4" class="td3">
                <asp:Button ID="btnSelect" runat="server" Text="查询" OnClick="btnSelect_Click" class="search"
                    onmouseout="this.className='search'" onmouseover="this.className='search_hover'"
                    ClientIDMode="Static" />
                <asp:Button ID="btnAdd" runat="server" Text="添加" class="add" onmouseout="this.className='add'"
                    onmouseover="this.className='add_hover'" />
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="updatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <GridViewExt:GridViewExt ID="GridView" CssClass="table" runat="server" Width="100%"
                ShowHeaderWhenEmpty="true" PageSize="10" AllowPaging="true" AutoGenerateColumns="False"
                AllowSorting="true" OnRowCommand="GridView_RowCommand" OnBindData="GridView_BindData">
                <Columns>
                    <asp:TemplateField HeaderText="序号">
                        <ItemTemplate>
                            <%# Container.DataItemIndex + 1 + (GridView.PageIndex-1)* GridView.PageSize %>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:BoundField HeaderText="功能名称" DataField="FUNCTIONNAME" />
                    <asp:BoundField HeaderText="功能地址" DataField="LINKURL" />
                    <asp:BoundField HeaderText="父功能" DataField="PARENTNAME" />
                    <asp:BoundField HeaderText="显示顺序" DataField="SORT" />
                    <asp:BoundField HeaderText="描述" DataField="DESCRIPTION" ItemStyle-Width="300px" />
                    <asp:TemplateField HeaderText="操作">
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtEdit" runat="server" CommandName="ed" Text="编辑" OnClientClick=<%# String.Format("return edit('{0}')",Eval("ID")) %>></asp:LinkButton>
                            <asp:LinkButton ID="lbtDelete" runat="server" OnClientClick="return confirm('您确认要删除吗?')"
                                CommandName="del" Text="删除" CommandArgument='<%# Eval("ID") %>'></asp:LinkButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </GridViewExt:GridViewExt>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
